<?php
/**
 * Created By PhpStorm
 * Author: patrick wu
 * Date: 2020/10/7
 * Time: 17:31
 */
namespace App\Service\Api;

use App\Http\Model\MongoDB\ShopTemplate;

class IndexService extends BaseService
{
    /**
     * 获取店铺首页模板
     * @return array
     */
    public function indexShow()
    {
        $where['templateType']  =   ShopTemplate::BASIC_TEMPLATE;
        $where['companyId']     =   '621b9cc5-11b3-4d0e-ad82-981351e25336';
        $where['appId']         =   '530defda-cb12-4d24-b0e8-dbfabb76393b';
        $where['_id']           =   'b45cd65d-1428-45c4-835d-076049721792';

        $info  =   ShopTemplate::where($where)->select(['_id', 'release', 'templateName', 'templateType', 'page', 'pageTitle', 'companyId', 'appId', 'sortOrder'])->first();
        return [true, empty($info) ? [] : $info];
    }

    /**
     * 获取我的页面模板
     * @return array
     */
    public function indexPersonal()
    {
        $where['templateType']  =   ShopTemplate::BASIC_TEMPLATE;
        $where['companyId']     =   '621b9cc5-11b3-4d0e-ad82-981351e25336';
        $where['appId']         =   '530defda-cb12-4d24-b0e8-dbfabb76393b';
        $where['_id']           =   'e8573972-aded-4c09-a52f-8c5cd781ca29';

        $info  =   ShopTemplate::where($where)->select(['_id', 'release', 'templateName', 'templateType', 'page', 'pageTitle', 'companyId', 'appId', 'sortOrder'])->first();
        return [true, empty($info) ? [] : $info];
    }

    /**
     * 直播列表模板
     * @return array
     */
    public function indexLive()
    {
        $where['templateType']  =   ShopTemplate::BASIC_TEMPLATE;
        $where['companyId']     =   '621b9cc5-11b3-4d0e-ad82-981351e25336';
        $where['appId']         =   '530defda-cb12-4d24-b0e8-dbfabb76393b';
        $where['_id']           =   'b3104d94-1f19-4cb2-8f96-a5148681f661';

        $info  =   ShopTemplate::where($where)->select(['_id', 'release', 'templateName', 'templateType', 'page', 'pageTitle', 'companyId', 'appId', 'sortOrder'])->first();
        return [true, empty($info) ? [] : $info];
    }

    /**
     * 购物车模板
     * @return array
     */
    public function indexCart()
    {
        $where['templateType']  =   ShopTemplate::BASIC_TEMPLATE;
        $where['companyId']     =   '621b9cc5-11b3-4d0e-ad82-981351e25336';
        $where['appId']         =   '530defda-cb12-4d24-b0e8-dbfabb76393b';
        $where['_id']           =   '3c479b84-f585-43d9-a8a2-ec80bb8eb1ac';

        $info  =   ShopTemplate::where($where)->select(['_id', 'release', 'templateName', 'templateType', 'page', 'pageTitle', 'companyId', 'appId', 'sortOrder'])->first();
        return [true, empty($info) ? [] : $info];
    }

    /**
     * 支付结果模板
     * @return array
     */
    public function indexPayResult()
    {
        $where['templateType']  =   ShopTemplate::BASIC_TEMPLATE;
        $where['companyId']     =   '621b9cc5-11b3-4d0e-ad82-981351e25336';
        $where['appId']         =   '530defda-cb12-4d24-b0e8-dbfabb76393b';
        $where['_id']           =   '140a1cae-13fa-4ba1-89e7-9562ceda811f';

        $info  =   ShopTemplate::where($where)->select(['_id', 'release', 'templateName', 'templateType', 'page', 'pageTitle', 'companyId', 'appId', 'sortOrder'])->first();
        return [true, empty($info) ? [] : $info];
    }

    /**
     * 会员招募模板
     * @return array
     */
    public function indexRecruit()
    {
        $where['templateType']  =   ShopTemplate::BASIC_TEMPLATE;
        $where['companyId']     =   '621b9cc5-11b3-4d0e-ad82-981351e25336';
        $where['appId']         =   '530defda-cb12-4d24-b0e8-dbfabb76393b';
        $where['_id']           =   'd450a4cb-d330-4a56-a6d0-ee4d5715efd1';

        $info  =   ShopTemplate::where($where)->select(['_id', 'release', 'templateName', 'templateType', 'page', 'pageTitle', 'companyId', 'appId', 'sortOrder'])->first();
        return [true, empty($info) ? [] : $info];
    }

}
